package file1;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Demo5 {
    public static void main(String[] args) throws IOException {
        //通过文件路径打开一个文件
        InputStream inputStream=new FileInputStream("./test.txt");
       while(true){
           int b=inputStream.read();
           if(b==-1){
               System.out.println("读取完毕");
               break;
           }
           System.out.println(b);
       }

        //释放资源，关闭字节流
        inputStream.close();
    }
}
